-
Notifications
You must be signed in to change notification settings - Fork 186
ODBC: Report error from Excel when executing an invalid query #611
ODBC: Report error from Excel when executing an invalid query #611
Conversation
- save error type and details on connection errors - start checking error type when reporting error (first: query syntax)
sql-odbc/src/odfesqlodbc/odbcapi.c
Outdated
|
||
MYLOG(ES_TRACE, "entering\n"); | ||
|
||
if (EnvironmentHandle) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should check this Statement, connection, then environment rather than the other way around. The most recently constructed handle gets priority.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Reversed order of handle checks
if (Sqlstate) | ||
utf8_to_ucs2(qstr_ansi, -1, Sqlstate, 6); | ||
if (mtxt && tlen <= BufferLength) { | ||
SQLULEN ulen = utf8_to_ucs2_lf(mtxt, tlen, FALSE, MessageText, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
SQLCHAR inputs aren't guaranteed to be UTF-8. On Windows it depends on the OS codepage for example (usually codepage CP1252), though on Windows the DM does the conversion for you. This should likely be a separate issue to fix.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 Will log another issue for this
Issue #, if available: #601
Description of changes:
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.